package io;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class StoringAndRecoveringData {
public static void main(String[] args) throws IOException{
	DataOutputStream out=new DataOutputStream(new FileOutputStream("Data.txt"));
	out.writeDouble(3.1415926);
	out.writeUTF("this is pi");
	out.writeDouble(1.41413);
	out.writeUTF("square of 2");
	out.close();
	DataInputStream in=new DataInputStream(new FileInputStream("Data.txt"));
	System.out.println(in.readDouble());
	System.out.println(in.readUTF());
	System.out.println(in.readDouble());
	System.out.println(in.readUTF());
	in.close();
}
}
